#!/usr/bin/env python
# -*- coding:utf-8 -*-
from conn.MySqlFactory import MySqlConfig


class PruTuutDb:
    conn = {}
    host = '172.17.0.9'
    user = 'tuut'
    passwd = "tuut"
    db = 'pru_tuut'
    port = 33069

    def __init__(self, host, user, passwd, db, port):
        self.host = host
        self.user = user
        self.passwd = passwd
        self.db = db
        self.port = port

    @staticmethod
    def get_pool() -> conn:
        # 连接业务数据库
        PruTuutDb.conn = MySqlConfig(host=PruTuutDb.host, user=PruTuutDb.user, passwd=PruTuutDb.passwd, db=PruTuutDb.db,
                                     port=PruTuutDb.port)
        return PruTuutDb.conn

    @staticmethod
    def get_conn() -> conn:
        # 连接业务数据库
        msdb = MySqlConfig(host=PruTuutDb.host, user=PruTuutDb.user, passwd=PruTuutDb.passwd, db=PruTuutDb.db,
                    port=PruTuutDb.port)
        return msdb.conn()
